home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / ListUI.java < prev    next >
Text File  |  1998-06-30  |  2KB  |  70 lines

  1. /*
  2.  * @(#)ListUI.java    1.3 97/09/29
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.plaf;
  22.  
  23. import com.sun.java.swing.JList;
  24. import java.awt.Point;
  25. import java.awt.Rectangle;
  26.  
  27.  
  28. /**
  29.  * The JList pluggable look and feel delegate.  This interface adds
  30.  * methods that allow the JList component to map locations, e.g. mouse
  31.  * coordinates, to list cells and from cell indices to the bounds of 
  32.  * the cell.
  33.  *
  34.  * @version 1.3 09/29/97
  35.  * @author Hans Muller
  36.  */
  37.  
  38. public abstract class ListUI extends ComponentUI
  39. {
  40.     /** 
  41.      * Convert a point in JList coordinates to the index
  42.      * of the cell at that location.  Returns -1 if there's no
  43.      * cell the specified location.  
  44.      * 
  45.      * @param location The JList relative coordinates of the cell
  46.      * @return The index of the cell at location, or -1.
  47.      */
  48.     public abstract int locationToIndex(JList list, Point location);
  49.  
  50.  
  51.     /** 
  52.      * Returns the origin of the specified item in JList
  53.      * coordinates, null if index isn't valid.
  54.      * 
  55.      * @param index The index of the JList cell.
  56.      * @return The origin of the index'th cell.
  57.      */
  58.     public abstract Point indexToLocation(JList list, int index);
  59.  
  60.  
  61.     /** 
  62.      * Returns the bounds of the specified item in JList
  63.      * coordinates, null if index isn't valid.
  64.      * 
  65.      * @param index The index of the JList cell.
  66.      * @return The bounds of the index'th cell.
  67.      */
  68.     public abstract Rectangle getCellBounds(JList list, int index1, int index2);
  69. }
  70.